//package com.iretailer.config;
//
//import com.iretailer.model.User;
//import com.iretailer.util.ResponeUtil;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.HandlerInterceptor;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * @author xjwtt
// * @date 2018/8/21
// */
//@Configuration
//public class MyInterceptor implements HandlerInterceptor {
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception {
//
//        boolean flag = true;
//        User userInfo = (User) request.getSession().getAttribute("UserInfo");
//        if (userInfo == null) {
////            response.sendRedirect("/");
//                ResponeUtil.sendFail(response,"401","code");
//                flag = false;
//        } else {
//            flag = true;
//        }
//        return flag;
//    }
//}
